package org.j4me.util;


// Defines the interface for a single operation executed by the commands queue
public abstract class Operation
{
  private boolean _deleted;
  
  private boolean _executing;
  private boolean _waiting;
  

	// Implement here the operation to be executed
	public abstract void execute(); 
	public void delete() {
		_deleted = true;
		if(_waiting)
			_waiting=false;
	}
	public boolean isDeleted() {
		return  _deleted;
	}
	public boolean isExecuting() {
		return _executing;
	}
	public void setExecuting(boolean executing) {
		_executing = executing;
	}
	public boolean isWaiting() {
		return _waiting;
	}
	public void setWaiting(boolean waiting) {
		_waiting = waiting;
	}
	
	public boolean isBusy()
	{
		return isWaiting() || isExecuting();
	}
}

